{% if dj_machine_qs %}
<table class="bz_buglist" cellpadding="4" cellspacing="0" width="100%">
<tbody>
  <tr class="bz_buglist_header" align="left">
  <th class="first-child">
  <input type="checkbox" id="ckb_all_id" name="ckb_all" onClick="checkAll('ckb_machine', 'ckb_all_id');"/>
  All</th>
  <th>Hostname</th>
  <th>Status</th>
  <th>Mode</th>
  <th>Build NO.</th>
  <th>Machine Group</th>
  <th>Reserve</th>
  <!--
  <th>More Info.</th>
  -->
  </tr>

  {% for m in dj_machine_qs %}

  <tr class="bz_bugitem {% cycle 'bz_row_even' 'bz_row_odd' %} {{dj_ltype}}_mstat_{{m.machine.get_status_display}}">

  <td class="first-child">
    {%if m.machine.reserve_email and m.machine.reserve_email != user.email %}
  <input type="checkbox" name="ckb_machine" value="{{m.machine.id}}" disabled="disabled" class="validate[minCheckbox[1]]"/>
    {%else%}
  <input type="checkbox" name="ckb_machine" value="{{m.machine.id}}" 
         class="validate[minCheckbox[1]]" {% if dj_is_autochecked %}checked="checked"{% endif %}/>
    {%endif%}
  </td>
			
  <td>{{m.machine.hostname}}</td>
  <td>{{m.machine.get_status_display}}</td>
  <td>{{m.machine.hwmode.name}}/{{m.machine.hwmode.get_arch_display}}</td>
    {% if m.machine.os_bldno and m.machine.dt_bldno %}
  <td>os: {{m.machine.os_bldno}}<br>dt: {{m.machine.dt_bldno}}</td>
    {% else %}
  <td></td>
    {% endif %}
  <td>{{m.machine.mgroup.name}}</td>

    {%if m.machine.reserve_email %}
  <td>{{m.machine.reserve_email}}</td>
    {%else %}
  <td></td>
    {%endif %}
  <!--
  <td><a id="item_{{m.machine.id}}" onMouseOver="showMessage('{{m.machine.id}}')" onMouseOut="hideMessage()">
    more</a></td>
  -->
  </tr>
  {%endfor%}

  <tr><td class="first-child" colspan="7">
    <hr>
  </td></tr>

  <tr><td class="first-child" colspan="7">
    <b><input type="checkbox" name="ckb_noti_mail" value="1"/>&nbsp;Send out notification after installation</b>
  </td></tr>

  <tr><td class="first-child" colspan="7">
    <input name="btn_install" id="btn_install" type="button" value="{{dj_sbmbtn_name}}"/>
  </td></tr>
</tbody></table>

  {% for m in dj_machine_qs %}

<div align="left" id="div_{{m.machine.id}}" class="tooltip_msg2" style="display:none">

<table>
  <tr>
    <td align="right">Hostname : </td>
    <td align="left">{{m.machine.hostname}}</td>
  </tr>
  <tr>
    <td align="right">Mac : </td>
    <td align="left">{{m.mac}}</td>
  </tr>
  <tr>
    <td align="right">Owner : </td>
    <td align="left">{{m.machine.owner.email}}</td>
  </tr>
  <tr>
    <td align="right">IP Addr. Type : </td>
    <td align="left">{{m.get_ipaddr_type_display}}</td>
  </tr>
  <tr>
    <td align="right">Group : </td>
    <td align="left">{{m.machine.mgroup.name}}</td>
  </tr>
  <tr>
    <td align="right">Location :</td>
    <td align="left">{{m.location.name}}</td>
  </tr>
  <tr>
    <td align="right">Mode : </td>
    <td align="left">{{m.machine.hwmode.name}}</td>
  </tr>
  <tr>
    <td align="right">HWConf : </td>
    <td align="left">{% if m.hwconf.psr_pnumber %}pcpu: {{m.hwconf.psr_pnumber}} vcpu: {{m.hwconf.psr_vnumber}}({{m.hwconf.psr_ckspeed}}) mem: {{m.hwconf.mem_size}}{% endif %}</td>
  </tr>
  <tr>
    <td align="right">Domain : </td>
    <td align="left">{{m.machine.site.domain}}</td>
  </tr>
  <tr>
    <td align="right">Serial No : </td>
    <td align="left">{{m.serial_no}}</td>
  </tr>
  <tr>
    <td align="right">SP Hostname : </td>
    <td align="left">{{m.sp_hostname}}</td>
  </tr>
  <tr>
    <td align="right">Notif. Emails : </td>
    <td align="left">{{m.machine.notification_email}}</td>
  </tr>
  <tr>
    <td align="right">Comments : </td>
    <td align="left">{{m.comments}}</td>
  </tr>
  </table>

</div>
  {% endfor %}
{% else %}
<p>No machine found</p>
<p></p>
{% endif %}
